#include <iostream>
#include <set>
#include <algorithm>
#include <cstring>
using namespace std;

int N, M, a[100+5], after[100+5];
bool vis[100+5];
int find(int t){
    for (int i = 1; i <= N; ++i) {
        if(after[i] == t && !vis[i]) { vis[i] = true; return i;}
    }
}

int main() {
    int T; cin >> T;
    while(T--){
        cin >> N >> M;
        set<int>have, need;
        for (int i = 1; i <= N; ++i) {
            cin >> a[i];
        }
        for (int i = 0; i < M; ++i) {
            int t; cin >> t;
            have.insert(t);
        }
        memcpy(after, a, sizeof(a));
        sort(after+1, after+N+1);
        memset(vis, false, sizeof(vis));
        for (int i = 1; i <= N; ++i) {
            int p = find(a[i]);
            if(i == p) continue;
            else if(i<p){
                for (int j = i; j < p; ++j) {
                    need.insert(j);
                }
            }else{
                for (int j = p; j < i; ++j) {
                    need.insert(j);
                }
            }
        }
        bool ans = true;
        for(auto it:need) if(!have.count(it)){ans = false; break;}
        if(ans) cout << "YES\n";
        else cout << "NO\n";
    }
    return 0;
}
